<html>
<head>
    <script src="../../resources/cross-frame-access.js"></script>
    <script>
        window.onload = function()
        {
            document.getElementsByTagName('h4')[0].innerHTML = document.domain;
            window.addEventListener('message', runTest);
        }

        runTest = function()
        {
            if (!window.testRunner)
                return;

            var event = document.createEvent('MouseEvent');
            event.initEvent( 'click', true, true );
            document.getElementById('anchorLink').dispatchEvent(event);

            parent.postMessage("clicked", "*");
        }
    </script>
</head>
<body>
    <h3>Frame-with-link-to-navigate</h3>
    <h4>DOMAIN</h4>
    <pre id='console'></pre>
    <a id="anchorLink" href="navigation-happened.html" target="toNavigate">Click me</a>
</body>
</html>
